
<?php
if (isset($res_com)) {
    if (!mysqli_num_rows($res_com)) { ?>
        <div class="alert alert-warning center-block text-center half-size">
             <b><?=  $row['pseudo'] ?></b> n'a pas encore publié un commentaire.
        </div>
    <?php }
    elseif (isset($row_com_stat)) { ?>
        <div class="clearfix stat">
            <div class="half-size pull-left border-right text-center">
                <h4>Nombre de commentaires publiés : <?= $row_com_stat['nb'] ?></h4>
            </div>
            <div class="half-size pull-left padding-left text-center">
                <h4>Note moyenne des commentaires publiés :
                    <?= colorNote($row_com_stat['moy']) ?>
                </h4>
            </div>
        </div>
    <?php }
    while ($row_com = mysqli_fetch_array($res_com)) { ?>
<div class="list-article list-commentaire clearfix">
    <div class="commentaire clearfix">
        <div class="info pull-left">
            <div>
                <h4><?php echo(strftime("le %d %B %Y à %H:%M:%S",strtotime($row_com['date']))) ?></h4>
            </div>
            <?= $row_com["content"] ?>
        </div>
        <div class="note pull-right">
            <?= colorNote($row_com['note']) ?>
        </div>
    </div>
    <div class="pull-left">
        <h4 class="comm-article">Pour <a href="<?= WEBROOT ?>article/article.php?id=<?= $row_com['id'] ?>" ><?php if(isset($row_com['title'])) { echo $row_com['title']; } ?></a></h4>
    </div>

</div>

<?php }
 } ?>